/*
 * @Author: Anjg
 * @Date: 2025-05-21 20:29:15
 * @LastEditTime: 2025-07-26 23:38:20
 * @Description:
 */
import Vue from 'vue';
import App from './App.vue';
import router from '@/router';
import Vant from 'vant';
import { Lazyload } from 'vant';
import 'vant/lib/index.css';
import 'lib-flexible';
import '@/assets/style/index.scss';
import components from '@/components';
import store from '@/store';
import * as commonFilters from '@/filters';
import Directives from '@/directives';
import { platformName } from '@/utils'
import SvgIcon from '@/components/base/svgIcon.vue'
require('./mock/index');
// if (process.env.VUE_APP_USE_MOCK === 'true') {
//     require('./mock/index');
// }

Vue.component('svg-icon', SvgIcon)
// 全局引入公共svg图标
const req = require.context('@/assets/icons', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)

// 注入到实例上
Vue.prototype.$os = platformName();
Vue.prototype.$store = store
Vue.use(Vant);
Vue.use(components);
Vue.use(Directives);
Vue.use(Lazyload);

// 加入filters
Object.keys(commonFilters).forEach((key) => {
    Vue.filter(key, commonFilters[key]);
});
Vue.config.productionTip = false;

new Vue({
    router,
    store,
    render: (h) => h(App)
}).$mount('#app');
